#sing @echo off & SetLocal EnableDelayedExpansion 
#newl set container=m4a|#newl set container=mp3|#newl set container=oga|#newl set container=mka|#newl set container=aac|#newl set container=flac|#newl set container=opus|#newl set container=wav|#newl set container=mp2|#newl set container=ogg|#newl set container=mkv|#newl set container=mp4|--select container--
#newl FOR /F "usebackq tokens=5,7,* delims=," %%a in ("#path#name-info-csv-sexagesimal.txt") do (
#newl set title=%%c
#newl set title=!title:"=!
#newl set title=!title::=,!
#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -c:a copy -vn -ss %%a -to %%b "#path!title!.%container%"|#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -b:a 64k -vn -ss %%a -to %%b "#path!title!.%container%"|#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -c:a opus -b:a 24k -vn -ss %%a -to %%b "#path!title!.%container%"|--choose bitrate--
#newl )

<comment>
Drop m4b file to the program.
Filename-info-csv-sexagesimal.txt has to be in the same dir.
You can get one from "1 -optional- Parse m4b file, extract chapters info to csv text file"
Program will create single audio files from m4b files using csv file.
--
Default output format is m4a.
If you want to encode to another format, 
change 2nd line: (#newl set container=m4a) to something else, and
change at the bottom: ("#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -c:a copy -vn")
to the one with bitrate: (#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -b:a 64k).
--
This program also removes quotemarks and : from the chapter title (last column).
--
This program uses 5,7,and everything after 7th column to extract chapters.
Columns are delimited by ,


everything after seventh column is in c.
if we needed 1,3, 8+
we would use 1,3,7,*, and discard c, and use d.

SetLocal EnableDelayedExpansion is for using assigning variables to other variables inside for loop.

We assign %%c to title,
and replace " with empty space.

We use set title=!title:"=! instead of set title=%title:"=%, because we are inside the loop.
"=emptyspace!, means replace " with empty space. ! is limiter here.

"#ppthapps\ffmpeg\ffprobe.exe" |-program file-
-i "#item" |--input--
-print_format compact |-print_format csv |-print_format default |-print_format flat |-print_format ini |-print_format json |-print_format xml |--choose output format--
-sexagesimal ||--time format, hh:mm:ss.microseconds (sexagesimal), or seconds.microseconds--
#choose what to log to file|-show_chapters |-sections |-show_data |-show_format |-show_frames |-show_packets |-show_streams |--choose what to show, only this part will go to info.txt file--
#remark output to file, filename|> "#path#name-info.txt" |--output info to file, works with show_xx only|


